<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 <meta>
  <!-- Stylesheets -->
  <link href="../web.css" type="text/css" rel="stylesheet"></link>
  <link href="../pygmentize.css" type="text/css" rel="stylesheet"></link>
  <title>VLFeat - Documentation - C API</title>
  <link rel="stylesheet" type="text/css" href="../doxygen.css"></style>

  <!-- Scripts-->
  
 </meta>

 <!-- Body Start -->
 <body>
  <div id="header">
   <!-- Google CSE Search Box Begins -->
   <form action="http://www.vlfeat.org/search.html" method="get" id="cse-search-box" enctype="application/x-www-form-urlencoded">
    <div>
     <input type="hidden" name="cx" value="003215582122030917471:oq23albfeam"></input>
     <input type="hidden" name="cof" value="FORID:11"></input>
     <input type="hidden" name="ie" value="UTF-8"></input>
     <input type="text" name="q" size="31"></input>
     <input type="submit" name="sa" value="Search"></input>
    </div>
   </form>
   <script src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en" xml:space="preserve" type="text/javascript"></script>
   <!-- Google CSE Search Box Ends -->
   <h1><a shape="rect" href="../index.html" class="plain"><span id="vlfeat">VLFeat</span><span id="dotorg">.org</span></a></h1>
  </div>
  <div id="headbanner">
   Documentation - C API
  </div>
  <div id="pagebody">
   <div id="sidebar"> <!-- Navigation Start -->
    <ul>
<li><a href="../index.html">Home</a>
</li>
<li><a href="../download.html">Download</a>
</li>
<li><a href="../doc.html">Documentation</a>
<ul>
<li><a href="../mdoc/mdoc.html">Matlab API</a>
</li>
<li><a href="index.html" class='active' >C API</a>
</li>
<li><a href="../man/man.html">Man pages</a>
</li>
</ul></li>
<li><a href="../overview/tut.html">Tutorials</a>
</li>
<li><a href="../applications/apps.html">Applications</a>
</li>
</ul>

   </div> <!-- sidebar -->
   <div id="content">
    
    <link rel="stylesheet" type="text/css" href="../doxygen.css"></style>
    <div class="doxygen">
<div>
<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">mathop.h File Reference</div>  </div>
</div>
<div class="contents">

<p>Math operations.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="generic_8h.html">generic.h</a>&quot;</code><br/>
<code>#include &lt;math.h&gt;</code><br/>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5103e2bf416806fb511feaa8ee96328f"></a><!-- doxytag: member="mathop.h::VL_LOG_OF_2" ref="a5103e2bf416806fb511feaa8ee96328f" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a5103e2bf416806fb511feaa8ee96328f">VL_LOG_OF_2</a>&#160;&#160;&#160;0.693147180559945</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Logarithm of 2 (math constant) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a19d43a5e0c355df553ebe825208a4cc1"></a><!-- doxytag: member="mathop.h::VL_PI" ref="a19d43a5e0c355df553ebe825208a4cc1" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a19d43a5e0c355df553ebe825208a4cc1">VL_PI</a>&#160;&#160;&#160;3.141592653589793</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pi (math constant) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a8088f3da04d6bce27544adaa6da948ca">VL_EPSILON_F</a>&#160;&#160;&#160;1.19209290E-07F</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">IEEE single precision epsilon (math constant)  <a href="#a8088f3da04d6bce27544adaa6da948ca"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#aa2d957b08ce16011fc3827c270cd2664">VL_EPSILON_D</a>&#160;&#160;&#160;2.220446049250313e-16</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">IEEE double precision epsilon (math constant)  <a href="#aa2d957b08ce16011fc3827c270cd2664"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afcbfd66dfa72bf495e08e1d622d6da0e"></a><!-- doxytag: member="mathop.h::VL_NAN_F" ref="afcbfd66dfa72bf495e08e1d622d6da0e" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#afcbfd66dfa72bf495e08e1d622d6da0e">VL_NAN_F</a>&#160;&#160;&#160;(vl_nan_f.value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">IEEE single precision NaN (not signaling) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7c8e51b4132fa5072a31ec38770e22c6"></a><!-- doxytag: member="mathop.h::VL_INFINITY_F" ref="a7c8e51b4132fa5072a31ec38770e22c6" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a7c8e51b4132fa5072a31ec38770e22c6">VL_INFINITY_F</a>&#160;&#160;&#160;(vl_infinity_f.value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">IEEE single precision positive infinity (not signaling) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3f9df65fc71880e96e21e93e3abfd99c"></a><!-- doxytag: member="mathop.h::VL_NAN_D" ref="a3f9df65fc71880e96e21e93e3abfd99c" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a3f9df65fc71880e96e21e93e3abfd99c">VL_NAN_D</a>&#160;&#160;&#160;(vl_nan_d.value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">IEEE double precision NaN (not signaling) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9eb876cf62894be62a2467db9db0bb03"></a><!-- doxytag: member="mathop.h::VL_INFINITY_D" ref="a9eb876cf62894be62a2467db9db0bb03" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a9eb876cf62894be62a2467db9db0bb03">VL_INFINITY_D</a>&#160;&#160;&#160;(vl_infinity_d.value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">IEEE double precision positive infinity (not signaling) <br/></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab3bfc8e36e1d3a558ad4d1ba7d028bc1"></a><!-- doxytag: member="mathop.h::VlFloatVectorComparisonFunction" ref="ab3bfc8e36e1d3a558ad4d1ba7d028bc1" args=")(vl_size dimension, float const *X, float const *Y)" -->
typedef float(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#ab3bfc8e36e1d3a558ad4d1ba7d028bc1">VlFloatVectorComparisonFunction</a> )(<a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> dimension, float const *X, float const *Y)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to a function to compare vectors of floats. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9f01157d716a8023720436416e5b7ebd"></a><!-- doxytag: member="mathop.h::VlDoubleVectorComparisonFunction" ref="a9f01157d716a8023720436416e5b7ebd" args=")(vl_size dimension, double const *X, double const *Y)" -->
typedef double(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a9f01157d716a8023720436416e5b7ebd">VlDoubleVectorComparisonFunction</a> )(<a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> dimension, double const *X, double const *Y)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to a function to compare vectors of doubles. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa4cc7d511f708d61bc8fe15c65ad6d74"></a><!-- doxytag: member="mathop.h::VlVectorComparisonType" ref="aa4cc7d511f708d61bc8fe15c65ad6d74" args="" -->
typedef enum <br class="typebreak"/>
<a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09ac">_VlVectorComparisonType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#aa4cc7d511f708d61bc8fe15c65ad6d74">VlVectorComparisonType</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Vector comparison types. <br/></td></tr>
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09ac">_VlVectorComparisonType</a> { <br/>
&#160;&#160;<a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09acaff42f6aa9da4f0d11415de32089a1348">VlDistanceL1</a>, 
<a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09acab44b9322465d703274acfa21690de9fd">VlDistanceL2</a>, 
<a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09aca8bd37a4dd18960b8faf2c52093227857">VlDistanceChi2</a>, 
<a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09acaa2290709524875cbabbce86ba2d28635">VlDistanceHellinger</a>, 
<br/>
&#160;&#160;<a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09acaed22a8624bfdae0b2ca92a43750bf68a">VlDistanceJS</a>, 
<a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09aca5e26182d2d853d6e16238535fd8f7f98">VlKernelL1</a>, 
<a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09acaad5fb6e24379dd36f94bdfb10068ec6c">VlKernelL2</a>, 
<a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09acad945961afcae876365e585655b3dbdde">VlKernelChi2</a>, 
<br/>
&#160;&#160;<a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09acae6735870a9191f6f9c44492bd2fdeae8">VlKernelHellinger</a>, 
<a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09aca2b327ebbf8e9ad7e76df758a9062145f">VlKernelJS</a>
<br/>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Vector comparison types.  <a href="mathop_8h.html#af7397bb42d71000754eafba9458b09ac">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a99beafd23bc68c4bf8fb525e4efb2749">vl_mod_2pi_f</a> (float x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fast <code>mod(x, 2 * VL_PI)</code>  <a href="#a99beafd23bc68c4bf8fb525e4efb2749"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a6ee66acb41ce542899a6e99e4fe5b6f3">vl_mod_2pi_d</a> (double x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fast <code>mod(x, 2 * VL_PI)</code>  <a href="#a6ee66acb41ce542899a6e99e4fe5b6f3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a7651faad897e764d74159d4661777115">vl_floor_f</a> (float x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Floor and convert to integer.  <a href="#a7651faad897e764d74159d4661777115"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a4573abdff2b32ef131f090a7cd8afeee">vl_floor_d</a> (double x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Floor and convert to integer.  <a href="#a4573abdff2b32ef131f090a7cd8afeee"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a2e33bdf5324485def067bbbe66a54f91">vl_ceil_f</a> (float x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Ceil and convert to integer.  <a href="#a2e33bdf5324485def067bbbe66a54f91"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a6a0c3cd1c2c65220bcdc472a5a9391d6">vl_ceil_d</a> (double x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Ceil and convert to integer.  <a href="#a6a0c3cd1c2c65220bcdc472a5a9391d6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a97fb4b325bc0dc8bb8618e132fab736c">vl_round_f</a> (float x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Round.  <a href="#a97fb4b325bc0dc8bb8618e132fab736c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#af3adf65b9d416b2438ccfe78748ed60f">vl_round_d</a> (double x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Round.  <a href="#af3adf65b9d416b2438ccfe78748ed60f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a772d390dd8d1fb4adc4eda6e0d8f4c0b">vl_abs_f</a> (float x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fast <code>abs(x)</code>  <a href="#a772d390dd8d1fb4adc4eda6e0d8f4c0b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a87c54a1c66beffacfba7bf7bac52fb09">vl_abs_d</a> (double x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fast <code>abs(x)</code>  <a href="#a87c54a1c66beffacfba7bf7bac52fb09"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a302745de850d5b18b49359a830b74f6d">vl_fast_atan2_f</a> (float y, float x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fast <code>atan2</code> approximation.  <a href="#a302745de850d5b18b49359a830b74f6d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#ae76d962e552bdddb02a687dd3dc38330">vl_fast_atan2_d</a> (double y, double x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fast <code>atan2</code> approximation.  <a href="#ae76d962e552bdddb02a687dd3dc38330"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a1a7ffdd0b23196a330e36d6e9aa8c6ff">vl_fast_resqrt_f</a> (float x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fast <code>resqrt</code> approximation.  <a href="#a1a7ffdd0b23196a330e36d6e9aa8c6ff"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a8aab2f55af664aaef0d51b84fb09ebc7">vl_fast_resqrt_d</a> (double x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fast <code>resqrt</code> approximation.  <a href="#a8aab2f55af664aaef0d51b84fb09ebc7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a69441a371eeaa0c183214d8f19204d46">vl_fast_sqrt_f</a> (float x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fast <code>sqrt</code> approximation.  <a href="#a69441a371eeaa0c183214d8f19204d46"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a8a7ca9f7a6df25bd6869f648f1e643d9">vl_fast_sqrt_d</a> (float x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fast <code>sqrt</code> approximation.  <a href="#a8a7ca9f7a6df25bd6869f648f1e643d9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="host_8h.html#aeb7c862765448a70017105efa4d25e7a">vl_uint32</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a07ed33a01737b8aa5716e46d1afdf0b8">vl_fast_sqrt_ui32</a> (<a class="el" href="host_8h.html#aeb7c862765448a70017105efa4d25e7a">vl_uint32</a> x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fast <code>sqrt</code> approximation.  <a href="#a07ed33a01737b8aa5716e46d1afdf0b8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="host_8h.html#ab2275d6c7bf6fc027151d11072b45f03">vl_uint16</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a7475cc5573d9ff6147ebc9e97097740b">vl_fast_sqrt_ui16</a> (<a class="el" href="host_8h.html#ab2275d6c7bf6fc027151d11072b45f03">vl_uint16</a> x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fast <code>sqrt</code> approximation.  <a href="#a7475cc5573d9ff6147ebc9e97097740b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="host_8h.html#a38fbd9a3cf53dfc9a5650c38497b7d35">vl_uint8</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#ad3ba8bee4d358e752175582321e96e10">vl_fast_sqrt_ui8</a> (<a class="el" href="host_8h.html#a38fbd9a3cf53dfc9a5650c38497b7d35">vl_uint8</a> x)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fast <code>sqrt</code> approximation.  <a href="#ad3ba8bee4d358e752175582321e96e10"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#acf470a9c2b4c9f91129f883a54d85bad">vl_get_vector_comparison_type_name</a> (int type)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the symbolic name of a vector comparison type.  <a href="#acf470a9c2b4c9f91129f883a54d85bad"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="mathop_8h.html#ab3bfc8e36e1d3a558ad4d1ba7d028bc1">VlFloatVectorComparisonFunction</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#ad5143f7d144cba8a1d302dacee14d23e">vl_get_vector_comparison_function_f</a> (<a class="el" href="mathop_8h.html#aa4cc7d511f708d61bc8fe15c65ad6d74">VlVectorComparisonType</a> type)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get vector comparison function from comparison type.  <a href="#ad5143f7d144cba8a1d302dacee14d23e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="mathop_8h.html#a9f01157d716a8023720436416e5b7ebd">VlDoubleVectorComparisonFunction</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a34ec850e1d4b291c4e7a4235206c23bd">vl_get_vector_comparison_function_d</a> (<a class="el" href="mathop_8h.html#aa4cc7d511f708d61bc8fe15c65ad6d74">VlVectorComparisonType</a> type)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get vector comparison function from comparison type.  <a href="#a34ec850e1d4b291c4e7a4235206c23bd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#ae38ee42a415c7958c38c02ea57cf9b4e">vl_eval_vector_comparison_on_all_pairs_f</a> (float *result, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> dimension, float const *X, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> numDataX, float const *Y, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> numDataY, <a class="el" href="mathop_8h.html#ab3bfc8e36e1d3a558ad4d1ba7d028bc1">VlFloatVectorComparisonFunction</a> function)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Evaluate vector comparison function on all vector pairs.  <a href="#ae38ee42a415c7958c38c02ea57cf9b4e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a2fa33c2469aa77aea316927d13e8e644">vl_eval_vector_comparison_on_all_pairs_d</a> (double *result, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> dimension, double const *X, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> numDataX, double const *Y, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> numDataY, <a class="el" href="mathop_8h.html#a9f01157d716a8023720436416e5b7ebd">VlDoubleVectorComparisonFunction</a> function)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Evaluate vector comparison function on all vector pairs.  <a href="#a2fa33c2469aa77aea316927d13e8e644"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" >union {</td></tr>
<tr><td class="memItemLeft" valign="top">}&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#a2930ae1c9c5c58257ef2ca4f7946ebc4">vl_nan_f</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">IEEE single precision quiet NaN constant.  <a href="#a2930ae1c9c5c58257ef2ca4f7946ebc4"></a><br/></td></tr>
<tr><td class="memItemLeft" >union {</td></tr>
<tr><td class="memItemLeft" valign="top">}&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#aa229f0ad87d42202ad17cdc019428455">vl_infinity_f</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">IEEE single precision infinity constant.  <a href="#aa229f0ad87d42202ad17cdc019428455"></a><br/></td></tr>
<tr><td class="memItemLeft" >union {</td></tr>
<tr><td class="memItemLeft" valign="top">}&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#ad5d519fcbb9f3c90414e6987df2e4cb5">vl_nan_d</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">IEEE double precision quiet NaN constant.  <a href="#ad5d519fcbb9f3c90414e6987df2e4cb5"></a><br/></td></tr>
<tr><td class="memItemLeft" >union {</td></tr>
<tr><td class="memItemLeft" valign="top">}&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathop_8h.html#afab36bf94fa017fd8c9023ab1c8caed1">vl_infinity_d</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">IEEE double precision infinity constant.  <a href="#afab36bf94fa017fd8c9023ab1c8caed1"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h2><a class="anchor" id="mathop-usage-vector-comparison"></a>
Comparing vectors</h2>
<p><a class="el" href="mathop_8h.html">mathop.h</a> includes a number of functions to quickly compute distances or similarity of pairs of vector. Applications include clustering and evaluation of SVM-like classifiers.</p>
<p>Use <a class="el" href="mathop_8h.html#ad5143f7d144cba8a1d302dacee14d23e" title="Get vector comparison function from comparison type.">vl_get_vector_comparison_function_f</a> or <a class="el" href="mathop_8h.html#a34ec850e1d4b291c4e7a4235206c23bd" title="Get vector comparison function from comparison type.">vl_get_vector_comparison_function_d</a> obtain an approprite function to comprare vectors of floats or doubles, respectively. Such functions are usually optimized (for instance, on X86 platforms they use the SSE vector extension) and are several times faster than a naive implementation. <a class="el" href="mathop_8h.html#ae38ee42a415c7958c38c02ea57cf9b4e" title="Evaluate vector comparison function on all vector pairs.">vl_eval_vector_comparison_on_all_pairs_f</a> and <a class="el" href="mathop_8h.html#a2fa33c2469aa77aea316927d13e8e644" title="Evaluate vector comparison function on all vector pairs.">vl_eval_vector_comparison_on_all_pairs_d</a> can be used to evaluate the comparison function on all pairs of one or two sequences of vectors.</p>
<p>Let <img class="formulaInl" alt="$ \mathbf{x} = (x_1,\dots,x_d) $" src="form_186.png"/> and <img class="formulaInl" alt="$ \mathbf{y} = (y_1,\dots,y_d) $" src="form_187.png"/> be two vectors. The following comparison functions are supported:</p>
<table class="doxtable">
<tr>
<td><img class="formulaInl" alt="$ l^1 $" src="form_166.png"/> </td><td><a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09acaff42f6aa9da4f0d11415de32089a1348">VlDistanceL1</a> </td><td><img class="formulaInl" alt="$ \sum_{i=1}^d |x_i - y_i| $" src="form_188.png"/> </td><td>l1 distance (squared intersection metric)  </td></tr>
<tr>
<td><img class="formulaInl" alt="$ l^2 $" src="form_189.png"/> </td><td><a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09acab44b9322465d703274acfa21690de9fd">VlDistanceL2</a> </td><td><img class="formulaInl" alt="$\sum_{i=1}^d (x_i - y_i)^2$" src="form_190.png"/> </td><td>Squared Euclidean disance  </td></tr>
<tr>
<td><img class="formulaInl" alt="$ \chi^2 $" src="form_62.png"/> </td><td><a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09aca8bd37a4dd18960b8faf2c52093227857">VlDistanceChi2</a> </td><td><img class="formulaInl" alt="$\sum_{i=1}^d \frac{(x_i - y_i)^2}{x_i + y_i}$" src="form_191.png"/> </td><td>Squared chi-square distance  </td></tr>
<tr>
<td>- </td><td><a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09acaa2290709524875cbabbce86ba2d28635">VlDistanceHellinger</a> </td><td><img class="formulaInl" alt="$\sum_{i=1}^d (\sqrt{x_i} - \sqrt{y_i})^2$" src="form_192.png"/> </td><td>Squared Hellinger's distance  </td></tr>
<tr>
<td>- </td><td><a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09acaed22a8624bfdae0b2ca92a43750bf68a">VlDistanceJS</a> </td><td><img class="formulaInl" alt="$ \sum_{i=1}^d \left( x_i \log\frac{2x_i}{x_i+y_i} + y_i \log\frac{2y_i}{x_i+y_i} \right) $" src="form_193.png"/>  </td><td>Squared Jensen-Shannon distance  </td></tr>
<tr>
<td><img class="formulaInl" alt="$ l^1 $" src="form_166.png"/> </td><td><a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09aca5e26182d2d853d6e16238535fd8f7f98">VlKernelL1</a> </td><td><img class="formulaInl" alt="$ \sum_{i=1}^d \min\{ x_i, y_i \} $" src="form_194.png"/> </td><td>intersection kernel  </td></tr>
<tr>
<td><img class="formulaInl" alt="$ l^2 $" src="form_189.png"/> </td><td><a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09acaad5fb6e24379dd36f94bdfb10068ec6c">VlKernelL2</a> </td><td><img class="formulaInl" alt="$\sum_{i=1}^d x_iy_i $" src="form_195.png"/> </td><td>linear kernel  </td></tr>
<tr>
<td><img class="formulaInl" alt="$ \chi^2 $" src="form_62.png"/> </td><td><a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09acad945961afcae876365e585655b3dbdde">VlKernelChi2</a> </td><td><img class="formulaInl" alt="$\sum_{i=1}^d 2 \frac{x_iy_i}{x_i + y_i}$" src="form_196.png"/> </td><td>chi-square kernel  </td></tr>
<tr>
<td>- </td><td><a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09acae6735870a9191f6f9c44492bd2fdeae8">VlKernelHellinger</a> </td><td><img class="formulaInl" alt="$\sum_{i=1}^d 2 \sqrt{x_i y_i}$" src="form_197.png"/> </td><td>Hellinger's kernel (Bhattacharya coefficient)  </td></tr>
<tr>
<td>- </td><td><a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09aca2b327ebbf8e9ad7e76df758a9062145f">VlKernelJS</a> </td><td><img class="formulaInl" alt="$ \sum_{i=1}^d \left( \frac{x_i}{2} \log_2\frac{x_i+y_i}{x_i} + \frac{y_i}{2} \log_2\frac{x_i+y_i}{y_i} \right) $" src="form_198.png"/>  </td><td>Jensen-Shannon kernel  </td></tr>
</table>
<dl class="remark"><dt><b>Remarks:</b></dt><dd>The definitions have been choosen so that corresponding kernels and distances are related by the equation: <p class="formulaDsp">
<img class="formulaDsp" alt="\[ d^2(\mathbf{x},\mathbf{y}) = k(\mathbf{x},\mathbf{x}) +k(\mathbf{y},\mathbf{y}) -k(\mathbf{x},\mathbf{y}) -k(\mathbf{y},\mathbf{x}) \]" src="form_199.png"/>
</p>
 This means that each of these distances can be interpreted as a squared distance or metric in the corresponding reproducing kernel Hilbert space. Notice in particular that the <img class="formulaInl" alt="$ l^1 $" src="form_166.png"/> or Manhattan distance is also a <em>squared</em> distance in this sense.</dd></dl>
<dl class="author"><dt><b>Author:</b></dt><dd>Andrea Vedaldi </dd></dl>
</div><hr/><h2>Define Documentation</h2>
<a class="anchor" id="aa2d957b08ce16011fc3827c270cd2664"></a><!-- doxytag: member="mathop.h::VL_EPSILON_D" ref="aa2d957b08ce16011fc3827c270cd2664" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define VL_EPSILON_D&#160;&#160;&#160;2.220446049250313e-16</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p><code>1.0 + VL_EPSILON_D</code> is the smallest representable double precision number greater than <code>1.0</code>. Numerically, <a class="el" href="mathop_8h.html#aa2d957b08ce16011fc3827c270cd2664" title="IEEE double precision epsilon (math constant)">VL_EPSILON_D</a> is equal to <img class="formulaInl" alt="$ 2^{-52} $" src="form_201.png"/>. </p>

</div>
</div>
<a class="anchor" id="a8088f3da04d6bce27544adaa6da948ca"></a><!-- doxytag: member="mathop.h::VL_EPSILON_F" ref="a8088f3da04d6bce27544adaa6da948ca" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define VL_EPSILON_F&#160;&#160;&#160;1.19209290E-07F</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p><code>1.0F + VL_EPSILON_F</code> is the smallest representable single precision number greater than <code>1.0F</code>. Numerically, <a class="el" href="mathop_8h.html#a8088f3da04d6bce27544adaa6da948ca" title="IEEE single precision epsilon (math constant)">VL_EPSILON_F</a> is equal to <img class="formulaInl" alt="$ 2^{-23} $" src="form_200.png"/>. </p>

</div>
</div>
<hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="af7397bb42d71000754eafba9458b09ac"></a><!-- doxytag: member="mathop.h::_VlVectorComparisonType" ref="af7397bb42d71000754eafba9458b09ac" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="mathop_8h.html#af7397bb42d71000754eafba9458b09ac">_VlVectorComparisonType</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="af7397bb42d71000754eafba9458b09acaff42f6aa9da4f0d11415de32089a1348"></a><!-- doxytag: member="VlDistanceL1" ref="af7397bb42d71000754eafba9458b09acaff42f6aa9da4f0d11415de32089a1348" args="" -->VlDistanceL1</em>&nbsp;</td><td>
<p>l1 distance (squared intersection metric) </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="af7397bb42d71000754eafba9458b09acab44b9322465d703274acfa21690de9fd"></a><!-- doxytag: member="VlDistanceL2" ref="af7397bb42d71000754eafba9458b09acab44b9322465d703274acfa21690de9fd" args="" -->VlDistanceL2</em>&nbsp;</td><td>
<p>squared l2 distance </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="af7397bb42d71000754eafba9458b09aca8bd37a4dd18960b8faf2c52093227857"></a><!-- doxytag: member="VlDistanceChi2" ref="af7397bb42d71000754eafba9458b09aca8bd37a4dd18960b8faf2c52093227857" args="" -->VlDistanceChi2</em>&nbsp;</td><td>
<p>squared Chi2 distance </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="af7397bb42d71000754eafba9458b09acaa2290709524875cbabbce86ba2d28635"></a><!-- doxytag: member="VlDistanceHellinger" ref="af7397bb42d71000754eafba9458b09acaa2290709524875cbabbce86ba2d28635" args="" -->VlDistanceHellinger</em>&nbsp;</td><td>
<p>squared Hellinger's distance </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="af7397bb42d71000754eafba9458b09acaed22a8624bfdae0b2ca92a43750bf68a"></a><!-- doxytag: member="VlDistanceJS" ref="af7397bb42d71000754eafba9458b09acaed22a8624bfdae0b2ca92a43750bf68a" args="" -->VlDistanceJS</em>&nbsp;</td><td>
<p>squared Jensen-Shannon distance </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="af7397bb42d71000754eafba9458b09aca5e26182d2d853d6e16238535fd8f7f98"></a><!-- doxytag: member="VlKernelL1" ref="af7397bb42d71000754eafba9458b09aca5e26182d2d853d6e16238535fd8f7f98" args="" -->VlKernelL1</em>&nbsp;</td><td>
<p>intersection kernel </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="af7397bb42d71000754eafba9458b09acaad5fb6e24379dd36f94bdfb10068ec6c"></a><!-- doxytag: member="VlKernelL2" ref="af7397bb42d71000754eafba9458b09acaad5fb6e24379dd36f94bdfb10068ec6c" args="" -->VlKernelL2</em>&nbsp;</td><td>
<p>l2 kernel </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="af7397bb42d71000754eafba9458b09acad945961afcae876365e585655b3dbdde"></a><!-- doxytag: member="VlKernelChi2" ref="af7397bb42d71000754eafba9458b09acad945961afcae876365e585655b3dbdde" args="" -->VlKernelChi2</em>&nbsp;</td><td>
<p>Chi2 kernel </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="af7397bb42d71000754eafba9458b09acae6735870a9191f6f9c44492bd2fdeae8"></a><!-- doxytag: member="VlKernelHellinger" ref="af7397bb42d71000754eafba9458b09acae6735870a9191f6f9c44492bd2fdeae8" args="" -->VlKernelHellinger</em>&nbsp;</td><td>
<p>Hellinger's kernel </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="af7397bb42d71000754eafba9458b09aca2b327ebbf8e9ad7e76df758a9062145f"></a><!-- doxytag: member="VlKernelJS" ref="af7397bb42d71000754eafba9458b09aca2b327ebbf8e9ad7e76df758a9062145f" args="" -->VlKernelJS</em>&nbsp;</td><td>
<p>Jensen-Shannon kernel </p>
</td></tr>
</table>
</dd>
</dl>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a87c54a1c66beffacfba7bf7bac52fb09"></a><!-- doxytag: member="mathop.h::vl_abs_d" ref="a87c54a1c66beffacfba7bf7bac52fb09" args="(double x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double vl_abs_d </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="mathop_8h.html#a772d390dd8d1fb4adc4eda6e0d8f4c0b" title="Fast abs(x) ">vl_abs_f</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a772d390dd8d1fb4adc4eda6e0d8f4c0b"></a><!-- doxytag: member="mathop.h::vl_abs_f" ref="a772d390dd8d1fb4adc4eda6e0d8f4c0b" args="(float x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float vl_abs_f </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>argument. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>abs(x)</code> </dd></dl>

</div>
</div>
<a class="anchor" id="a6a0c3cd1c2c65220bcdc472a5a9391d6"></a><!-- doxytag: member="mathop.h::vl_ceil_d" ref="a6a0c3cd1c2c65220bcdc472a5a9391d6" args="(double x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long int vl_ceil_d </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="mathop_8h.html#a2e33bdf5324485def067bbbe66a54f91" title="Ceil and convert to integer.">vl_ceil_f</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a2e33bdf5324485def067bbbe66a54f91"></a><!-- doxytag: member="mathop.h::vl_ceil_f" ref="a2e33bdf5324485def067bbbe66a54f91" args="(float x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long int vl_ceil_f </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>argument. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>lceilf(x)</code> </dd></dl>

</div>
</div>
<a class="anchor" id="a2fa33c2469aa77aea316927d13e8e644"></a><!-- doxytag: member="mathop.h::vl_eval_vector_comparison_on_all_pairs_d" ref="a2fa33c2469aa77aea316927d13e8e644" args="(double *result, vl_size dimension, double const *X, vl_size numDataX, double const *Y, vl_size numDataY, VlDoubleVectorComparisonFunction function)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">vl_eval_vector_comparison_on_all_pairs_d </td>
          <td>(</td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>result</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>dimension</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double const *&#160;</td>
          <td class="paramname"><em>X</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>numDataX</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double const *&#160;</td>
          <td class="paramname"><em>Y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>numDataY</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="mathop_8h.html#a9f01157d716a8023720436416e5b7ebd">VlDoubleVectorComparisonFunction</a>&#160;</td>
          <td class="paramname"><em>function</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="mathop_8h.html#ae38ee42a415c7958c38c02ea57cf9b4e" title="Evaluate vector comparison function on all vector pairs.">vl_eval_vector_comparison_on_all_pairs_f</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ae38ee42a415c7958c38c02ea57cf9b4e"></a><!-- doxytag: member="mathop.h::vl_eval_vector_comparison_on_all_pairs_f" ref="ae38ee42a415c7958c38c02ea57cf9b4e" args="(float *result, vl_size dimension, float const *X, vl_size numDataX, float const *Y, vl_size numDataY, VlFloatVectorComparisonFunction function)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">vl_eval_vector_comparison_on_all_pairs_f </td>
          <td>(</td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>result</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>dimension</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float const *&#160;</td>
          <td class="paramname"><em>X</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>numDataX</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float const *&#160;</td>
          <td class="paramname"><em>Y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>numDataY</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="mathop_8h.html#ab3bfc8e36e1d3a558ad4d1ba7d028bc1">VlFloatVectorComparisonFunction</a>&#160;</td>
          <td class="paramname"><em>function</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">result</td><td>comparison matrix (output). </td></tr>
    <tr><td class="paramname">dimension</td><td>number of vector components (rows of <em>X</em> and <em>Y</em>). </td></tr>
    <tr><td class="paramname">X</td><td>data matrix X. </td></tr>
    <tr><td class="paramname">Y</td><td>data matrix Y. </td></tr>
    <tr><td class="paramname">numDataX</td><td>number of vectors in <em>X</em> (columns of <em>X</em>) </td></tr>
    <tr><td class="paramname">numDataY</td><td>number of vectros in <em>Y</em> (columns of <em>Y</em>) </td></tr>
    <tr><td class="paramname">function</td><td>vector comparison function.</td></tr>
  </table>
  </dd>
</dl>
<p>The function evaluates <em>function</em> on all pairs of columns from matrices <em>X</em> and <em>Y</em>, filling a <em>numDataX</em> by <em>numDataY</em> matrix.</p>
<p>If <em>Y</em> is a null pointer the function compares all columns from <em>X</em> with themselves. </p>

</div>
</div>
<a class="anchor" id="ae76d962e552bdddb02a687dd3dc38330"></a><!-- doxytag: member="mathop.h::vl_fast_atan2_d" ref="ae76d962e552bdddb02a687dd3dc38330" args="(double y, double x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double vl_fast_atan2_d </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>x</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="mathop_8h.html#a302745de850d5b18b49359a830b74f6d" title="Fast atan2 approximation.">vl_fast_atan2_f</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a302745de850d5b18b49359a830b74f6d"></a><!-- doxytag: member="mathop.h::vl_fast_atan2_f" ref="a302745de850d5b18b49359a830b74f6d" args="(float y, float x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float vl_fast_atan2_f </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">y</td><td>argument. </td></tr>
    <tr><td class="paramname">x</td><td>argument.</td></tr>
  </table>
  </dd>
</dl>
<p>The function computes a relatively rough but fast approximation of <code>atan2(y,x)</code>.</p>
<dl class="user"><dt><b>Algorithm</b></dt><dd></dd></dl>
<p>The algorithm approximates the function <img class="formulaInl" alt="$ f(r)=atan((1-r)/(1+r)) $" src="form_202.png"/>, <img class="formulaInl" alt="$ r \in [-1,1] $" src="form_203.png"/> with a third order polynomial <img class="formulaInl" alt="$ f(r)=c_0 + c_1 r + c_2 r^2 + c_3 r^3 $" src="form_204.png"/>. To fit the polynomial we impose the constraints</p>
<p class="formulaDsp">
<img class="formulaDsp" alt="\begin{eqnarray*} f(+1) &amp;=&amp; c_0 + c_1 + c_2 + c_3 = atan(0) = 0,\\ f(-1) &amp;=&amp; c_0 - c_1 + c_2 - c_3 = atan(\infty) = \pi/2,\\ f(0) &amp;=&amp; c_0 = atan(1) = \pi/4. \end{eqnarray*}" src="form_205.png"/>
</p>
<p>The last degree of freedom is fixed by minimizing the <img class="formulaInl" alt="$ l^{\infty} $" src="form_206.png"/> error, which yields</p>
<p class="formulaDsp">
<img class="formulaDsp" alt="\[ c_0=\pi/4, \quad c_1=-0.9675, \quad c_2=0, \quad c_3=0.1821, \]" src="form_207.png"/>
</p>
<p>with maximum error of 0.0061 radians at 0.35 degrees.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Approximation of <code>atan2(y,x)</code>. </dd></dl>

</div>
</div>
<a class="anchor" id="a8aab2f55af664aaef0d51b84fb09ebc7"></a><!-- doxytag: member="mathop.h::vl_fast_resqrt_d" ref="a8aab2f55af664aaef0d51b84fb09ebc7" args="(double x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double vl_fast_resqrt_d </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="mathop_8h.html#a8aab2f55af664aaef0d51b84fb09ebc7" title="Fast resqrt approximation.">vl_fast_resqrt_d</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a1a7ffdd0b23196a330e36d6e9aa8c6ff"></a><!-- doxytag: member="mathop.h::vl_fast_resqrt_f" ref="a1a7ffdd0b23196a330e36d6e9aa8c6ff" args="(float x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float vl_fast_resqrt_f </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>argument. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>approximation of <code>resqrt(x)</code>.</dd></dl>
<p>The function quickly computes an approximation of <img class="formulaInl" alt="$ x^{-1/2} $" src="form_208.png"/>.</p>
<dl class="user"><dt><b>Algorithm</b></dt><dd></dd></dl>
<p>The goal is to compute <img class="formulaInl" alt="$ y = x^{-1/2} $" src="form_209.png"/>, which we do by finding the solution of <img class="formulaInl" alt="$ 0 = f(y) = y^{-2} - x $" src="form_210.png"/> by two Newton steps. Each Newton iteration is given by</p>
<p class="formulaDsp">
<img class="formulaDsp" alt="\[ y \leftarrow y - \frac{f(y)}{\frac{df(y)}{dy}} = y + \frac{1}{2} (y-xy^3) = \frac{y}{2} \left( 3 - xy^2 \right) \]" src="form_211.png"/>
</p>
<p>which yields a simple polynomial update rule.</p>
<p>The clever bit (attributed to either J. Carmack or G. Tarolli) is the way an initial guess <img class="formulaInl" alt="$ y \approx x^{-1/2} $" src="form_212.png"/> is chosen.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a href="http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf">Inverse Sqare Root</a>. </dd></dl>

</div>
</div>
<a class="anchor" id="a8a7ca9f7a6df25bd6869f648f1e643d9"></a><!-- doxytag: member="mathop.h::vl_fast_sqrt_d" ref="a8a7ca9f7a6df25bd6869f648f1e643d9" args="(float x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double vl_fast_sqrt_d </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="mathop_8h.html#a69441a371eeaa0c183214d8f19204d46" title="Fast sqrt approximation.">vl_fast_sqrt_f</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a69441a371eeaa0c183214d8f19204d46"></a><!-- doxytag: member="mathop.h::vl_fast_sqrt_f" ref="a69441a371eeaa0c183214d8f19204d46" args="(float x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float vl_fast_sqrt_f </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>argument. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>approximation of <code>sqrt(x)</code>.</dd></dl>
<p>The function computes a cheap approximation of <code>sqrt(x)</code>.</p>
<dl class="user"><dt><b>Floating-point algorithm</b></dt><dd></dd></dl>
<p>For the floating point cases, the function uses <a class="el" href="mathop_8h.html#a1a7ffdd0b23196a330e36d6e9aa8c6ff" title="Fast resqrt approximation.">vl_fast_resqrt_f</a> (or <a class="el" href="mathop_8h.html#a8aab2f55af664aaef0d51b84fb09ebc7" title="Fast resqrt approximation.">vl_fast_resqrt_d</a>) to compute <code>x * vl_fast_resqrt_f(x)</code>.</p>
<dl class="user"><dt><b>Integer algorithm</b></dt><dd></dd></dl>
<p>We seek for the largest integer <em>y</em> such that <img class="formulaInl" alt="$ y^2 \leq x $" src="form_213.png"/>. Write <img class="formulaInl" alt="$ y = w + b_k 2^k + z $" src="form_214.png"/> where the binary expansion of the various variable is</p>
<p class="formulaDsp">
<img class="formulaDsp" alt="\[ x = \sum_{i=0}^{n-1} 2^i a_i, \qquad w = \sum_{i=k+1}^{m-1} 2^i b_i, \qquad z = \sum_{i=0}^{k-1} 2^i b_i. \]" src="form_215.png"/>
</p>
<p>Assume <em>w</em> known. Expanding the square and using the fact that <img class="formulaInl" alt="$ b_k^2=b_k $" src="form_216.png"/>, we obtain the following constraint for <img class="formulaInl" alt="$ b_k $" src="form_217.png"/> and <em>z:</em> </p>
<p class="formulaDsp">
<img class="formulaDsp" alt="\[ x - w^2 \geq 2^k ( 2 w + 2^k ) b_k + z (z + 2wz + 2^{k+1}z b_k) \]" src="form_218.png"/>
</p>
<p>A necessary condition for <img class="formulaInl" alt="$ b_k = 1 $" src="form_219.png"/> is that this equation is satisfied for <img class="formulaInl" alt="$ z = 0 $" src="form_220.png"/> (as the second term is always non-negative). In fact, this condition is also sufficient, since we are looking for the <em>largest</em> solution <em>y</em>.</p>
<p>This yields the following iterative algorithm. First, note that if <em>x</em> is stored in <em>n</em> bits, where <em>n</em> is even, then the integer square root does not require more than <img class="formulaInl" alt="$ m = n / 2 $" src="form_221.png"/> bit to be stored. Thus initially, <img class="formulaInl" alt="$ w = 0 $" src="form_222.png"/> and <img class="formulaInl" alt="$ k = m - 1 = n/2 - 1 $" src="form_223.png"/>. Then, at each iteration the equation is tested, determining <img class="formulaInl" alt="$ b_{m-1}, b_{m-2}, ... $" src="form_224.png"/> in this order. </p>

</div>
</div>
<a class="anchor" id="a7475cc5573d9ff6147ebc9e97097740b"></a><!-- doxytag: member="mathop.h::vl_fast_sqrt_ui16" ref="a7475cc5573d9ff6147ebc9e97097740b" args="(vl_uint16 x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="host_8h.html#ab2275d6c7bf6fc027151d11072b45f03">vl_uint16</a> vl_fast_sqrt_ui16 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="host_8h.html#ab2275d6c7bf6fc027151d11072b45f03">vl_uint16</a>&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="mathop_8h.html#a69441a371eeaa0c183214d8f19204d46" title="Fast sqrt approximation.">vl_fast_sqrt_f</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a07ed33a01737b8aa5716e46d1afdf0b8"></a><!-- doxytag: member="mathop.h::vl_fast_sqrt_ui32" ref="a07ed33a01737b8aa5716e46d1afdf0b8" args="(vl_uint32 x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="host_8h.html#aeb7c862765448a70017105efa4d25e7a">vl_uint32</a> vl_fast_sqrt_ui32 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="host_8h.html#aeb7c862765448a70017105efa4d25e7a">vl_uint32</a>&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="mathop_8h.html#a69441a371eeaa0c183214d8f19204d46" title="Fast sqrt approximation.">vl_fast_sqrt_f</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ad3ba8bee4d358e752175582321e96e10"></a><!-- doxytag: member="mathop.h::vl_fast_sqrt_ui8" ref="ad3ba8bee4d358e752175582321e96e10" args="(vl_uint8 x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="host_8h.html#a38fbd9a3cf53dfc9a5650c38497b7d35">vl_uint8</a> vl_fast_sqrt_ui8 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="host_8h.html#a38fbd9a3cf53dfc9a5650c38497b7d35">vl_uint8</a>&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="mathop_8h.html#a69441a371eeaa0c183214d8f19204d46" title="Fast sqrt approximation.">vl_fast_sqrt_f</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a4573abdff2b32ef131f090a7cd8afeee"></a><!-- doxytag: member="mathop.h::vl_floor_d" ref="a4573abdff2b32ef131f090a7cd8afeee" args="(double x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long int vl_floor_d </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="mathop_8h.html#a7651faad897e764d74159d4661777115" title="Floor and convert to integer.">vl_floor_f</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a7651faad897e764d74159d4661777115"></a><!-- doxytag: member="mathop.h::vl_floor_f" ref="a7651faad897e764d74159d4661777115" args="(float x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long int vl_floor_f </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>argument. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Similar to <code></code>(int) floor(x) </dd></dl>

</div>
</div>
<a class="anchor" id="a34ec850e1d4b291c4e7a4235206c23bd"></a><!-- doxytag: member="mathop.h::vl_get_vector_comparison_function_d" ref="a34ec850e1d4b291c4e7a4235206c23bd" args="(VlVectorComparisonType type)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">vl_get_vector_comparison_function_d </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="mathop_8h.html#aa4cc7d511f708d61bc8fe15c65ad6d74">VlVectorComparisonType</a>&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="mathop_8h.html#ad5143f7d144cba8a1d302dacee14d23e" title="Get vector comparison function from comparison type.">vl_get_vector_comparison_function_f</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ad5143f7d144cba8a1d302dacee14d23e"></a><!-- doxytag: member="mathop.h::vl_get_vector_comparison_function_f" ref="ad5143f7d144cba8a1d302dacee14d23e" args="(VlVectorComparisonType type)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">vl_get_vector_comparison_function_f </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="mathop_8h.html#aa4cc7d511f708d61bc8fe15c65ad6d74">VlVectorComparisonType</a>&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>vector comparison type. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>comparison function. </dd></dl>

</div>
</div>
<a class="anchor" id="acf470a9c2b4c9f91129f883a54d85bad"></a><!-- doxytag: member="mathop.h::vl_get_vector_comparison_type_name" ref="acf470a9c2b4c9f91129f883a54d85bad" args="(int type)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char const* vl_get_vector_comparison_type_name </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>vector comparison type. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>data symbolic name. </dd></dl>

</div>
</div>
<a class="anchor" id="a6ee66acb41ce542899a6e99e4fe5b6f3"></a><!-- doxytag: member="mathop.h::vl_mod_2pi_d" ref="a6ee66acb41ce542899a6e99e4fe5b6f3" args="(double x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double vl_mod_2pi_d </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="mathop_8h.html#a99beafd23bc68c4bf8fb525e4efb2749" title="Fast mod(x, 2 * VL_PI)">vl_mod_2pi_f</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a99beafd23bc68c4bf8fb525e4efb2749"></a><!-- doxytag: member="mathop.h::vl_mod_2pi_f" ref="a99beafd23bc68c4bf8fb525e4efb2749" args="(float x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float vl_mod_2pi_f </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>input value. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>mod(x, 2 * VL_PI)</code></dd></dl>
<p>The function is optimized for small absolute values of <em>x</em>.</p>
<p>The result is guaranteed to be not smaller than 0. However, due to finite numerical precision and rounding errors, the result can be equal to 2 * VL_PI (for instance, if <code>x</code> is a very small negative number). </p>

</div>
</div>
<a class="anchor" id="af3adf65b9d416b2438ccfe78748ed60f"></a><!-- doxytag: member="mathop.h::vl_round_d" ref="af3adf65b9d416b2438ccfe78748ed60f" args="(double x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long int vl_round_d </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>argument. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>lround(x)</code> This function is either the same or similar to C99 <code>lround()</code>. </dd></dl>

</div>
</div>
<a class="anchor" id="a97fb4b325bc0dc8bb8618e132fab736c"></a><!-- doxytag: member="mathop.h::vl_round_f" ref="a97fb4b325bc0dc8bb8618e132fab736c" args="(float x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long int vl_round_f </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>argument. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>lroundf(x)</code> This function is either the same or similar to C99 <code>lroundf()</code>. </dd></dl>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="afab36bf94fa017fd8c9023ab1c8caed1"></a><!-- doxytag: member="mathop.h::vl_infinity_d" ref="afab36bf94fa017fd8c9023ab1c8caed1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">union { ... }  <a class="el" href="mathop_8h.html#afab36bf94fa017fd8c9023ab1c8caed1">vl_infinity_d</a><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="aa229f0ad87d42202ad17cdc019428455"></a><!-- doxytag: member="mathop.h::vl_infinity_f" ref="aa229f0ad87d42202ad17cdc019428455" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">union { ... }  <a class="el" href="mathop_8h.html#aa229f0ad87d42202ad17cdc019428455">vl_infinity_f</a><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="ad5d519fcbb9f3c90414e6987df2e4cb5"></a><!-- doxytag: member="mathop.h::vl_nan_d" ref="ad5d519fcbb9f3c90414e6987df2e4cb5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">union { ... }  <a class="el" href="mathop_8h.html#ad5d519fcbb9f3c90414e6987df2e4cb5">vl_nan_d</a><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a2930ae1c9c5c58257ef2ca4f7946ebc4"></a><!-- doxytag: member="mathop.h::vl_nan_f" ref="a2930ae1c9c5c58257ef2ca4f7946ebc4" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">union { ... }  <a class="el" href="mathop_8h.html#a2930ae1c9c5c58257ef2ca4f7946ebc4">vl_nan_f</a><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
</div>
     <!-- Doc Here -->
    </div>
   
   </div>
   <div class="clear">&nbsp;</div>
  </div> <!-- pagebody -->
  <div id="footer">
   &copy; 2007-12 Andrea Vedaldi and Brian Fulkerson
  </div> <!-- footer -->

  <!-- Google Analytics Begins -->
  <script xml:space="preserve" type="text/javascript">
   //<![CDATA[
    var localre = /vlfeat.org/;
    if(document.location.host.search(localre) != -1)
    {
   var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
   document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
   }
   //]]>
  </script>
  <script xml:space="preserve" type="text/javascript">
    //<![CDATA[
    var localre = /vlfeat.org/;
    if(document.location.host.search(localre) != -1)
    {

   try {
   var pageTracker = _gat._getTracker("UA-4936091-2");
   pageTracker._trackPageview();
   } catch(err) {}

   }
   //]]>
  </script>
  <!-- Google Analytics Ends -->
 </body>
</html>

 
